﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
using System.Windows.Forms;

namespace CapaPresentacion
{
    public partial class FrmRptFactura : Form
    {
        public static string MiCod_fact, V_Venta, IGV, Total, NumeroLetras;

        public FrmRptFactura()
        {
            InitializeComponent();
        }

        private void FrmRptFactura_Load(object sender, EventArgs e)
        {
            this.crvFactura.ReportSource = null;
            ParameterDiscreteValue Cod_fact = new ParameterDiscreteValue();
            ParameterDiscreteValue M_IGV = new ParameterDiscreteValue();
            ParameterDiscreteValue M_VVenta = new ParameterDiscreteValue();
            ParameterDiscreteValue M_Total = new ParameterDiscreteValue();
            ParameterDiscreteValue M_NumLetras = new ParameterDiscreteValue();
            Cod_fact.Value = MiCod_fact.ToString();
            M_VVenta.Value = V_Venta.ToString();
            M_IGV.Value = IGV.ToString();
            M_Total.Value = Total.ToString();
            M_NumLetras.Value = NumeroLetras.ToString();

            ParameterFields tabla = new ParameterFields();
            ParameterField temp = default(ParameterField);

            temp = new ParameterField();
            temp.CurrentValues.Add(Cod_fact);
            temp.ParameterFieldName = "@num_fact";
            tabla.Add(temp);

            temp = new ParameterField();
            temp.CurrentValues.Add(M_VVenta);
            temp.ParameterFieldName = "@MONTO1";
            tabla.Add(temp);

            temp = new ParameterField();
            temp.CurrentValues.Add(M_IGV);
            temp.ParameterFieldName = "@MONTO2";
            tabla.Add(temp);

            temp = new ParameterField();
            temp.CurrentValues.Add(M_Total);
            temp.ParameterFieldName = "@MONTO3";
            tabla.Add(temp);

            temp = new ParameterField();
            temp.CurrentValues.Add(M_NumLetras);
            temp.ParameterFieldName = "@LETRAS";
            tabla.Add(temp);

            //this.crvFactura.ReportSource = new ReporteFactura();
            //this.crvFactura.ParameterFieldInfo = tabla;
        }
    }
}
